export default {
  // Global page headers: https://go.nuxtjs.dev/config-head
  head: {
    title: 'nuxtdemo2',
    htmlAttrs: {
      lang: 'en'
    },
    meta: [
      { charset: 'utf-8' },
      { name: 'viewport', content: 'width=device-width, initial-scale=1' },
      { hid: 'description', name: 'description', content: '' },
      { name: 'format-detection', content: 'telephone=no' }
    ],
    link: [
      { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }
    ]
  },
  loading:{color:'#409EFF'},
  // Global CSS: https://go.nuxtjs.dev/config-css
  // 'swiper/swiper-bundle.css',
  css: [
    'element-ui/lib/theme-chalk/index.css','~assets/css/test.css','vue-awesome-swiper/node_modules/swiper/dist/css/swiper.min.css'

  ],
  styleResources:{
    scss:['~assets/css/global.scss']
  },
  router:{
    middleware:'router_set',
    //扩展路由
    extendRoutes(routes,resolve){
      routes.push({
        name:'home',
        path:'/index',
        component:resolve(__dirname,'pages/index.vue')
      })
    }
  },
  axios:{
    proxy:true
  },
  proxy:{
    // '/app/':{
    //   target:'https://api.cswendu.com/cswd/public/index.php/api/gen2/',
    //   changeOrigin:true,
    //   logLevel:'debug',
    // },
    '/index/':{
      target:'http://www.hunzsb.com/api',
      // target:'http://192.168.1.65/',
      changeOrigin:true,
      logLevel:'debug',
    },
  },
  // Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
  plugins: [
    '@/plugins/element-ui',
     { src: "@/plugins/vue-awesome-swiper", ssr: false },
     { src: "@/plugins/global", ssr: false },
     { src: "@/plugins/request", ssr: true },
  ],

  // Auto import components: https://go.nuxtjs.dev/config-components
  components: true,

  // Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules
  buildModules: [
  ],

  // Modules: https://go.nuxtjs.dev/config-modules
  modules: [
    '@nuxtjs/style-resources',
    '@nuxtjs/axios',
    "@nuxtjs/proxy"
  ],

  // Build Configuration: https://go.nuxtjs.dev/config-build
  build: {
    transpile: [/^element-ui/],
  }
}
